package com.kotasoft.iip.processor.concomitance;

import java.util.List;

import javax.inject.Inject;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;

import com.kotasoft.iip.model.insurance.Contract;
import com.kotasoft.iip.model.insurance.Order;
import com.kotasoft.iip.model.interfaces.HasContract;
import com.kotasoft.iip.services.OrderService;

public class CheckPendingOrder implements Processor {

	@Inject
	private OrderService orderService;

	public void process(Exchange exchange) throws Exception {
		Contract contract = exchange.getIn().getMandatoryBody(HasContract.class).getContract();
		List<Order> pendingOrders = orderService.getPendingOrders(contract);
		if (!pendingOrders.isEmpty()) {

		}
	}

}
